$('#outcollection').click(function () {
    layer.msg('出厂方向数据采集中', {icon: 1});
    var time = getLocalTime();
    var supplierName = $('#supplierNameCode').val();
    var customerName = $('#customerNameCode').val();
    var materailName = $('#materialNameCode').val();
    //采集的重量
    var weight = $('#sec').html();
    var max = $('#max').val();
    if(weight=='异常'){
        layer.msg('当前采集的数据为‘异常’！请确认采集服务程序是否开启', {time:30*1000});
        return false;
    }
    if(parseFloat(weight)>parseFloat(max)){
        layer.msg('超载，无法计量', {icon: 1});
        return false;
    }
    var unloadSymbol = $('#unloadSymbol').val();
    var returnSymbol = $('#returnSymbol').val();

    if(unloadSymbol=='0'&&returnSymbol=='0'){
        layer.msg('库房未操作，无法采集', {icon: 1});
        return false;
    }
    if(unloadSymbol=='未确认'&&returnSymbol=='未退货'){
        layer.msg('库房未操作，无法采集', {icon: 1});
        return false;
    }

    //表示出厂销售
    if(supplierName=='益达'||supplierName=='益隆'){
        $('#source').hide();
        $('#gross').val(weight);
        $('#grossWeightP').val(people);
        $('#grossTime').val( time);
        $('#grossWeightSite').val(position);
    }
    //表示进厂采购
    if(customerName=='益达'||customerName=='益隆'){
        //设置皮重
        var grossFirst = $('#gross').val();
        $('#source').show();
        $('#tare').val( weight);
        $('#tareP').val(people);
        $('#tareSite').val(position);
        $('#tareTime').val(time);
    }
    //判断关闭标记
    var grossW = $('#gross').val();
    var tareW = $('#tare').val();
    if(!((grossW == '0'||grossW=='') || (tareW == '0'||tareW==''))){
        var suttle = parseFloat(grossW) - parseFloat(tareW);
        if(suttle<0){
            $('#suttle').val(-1*suttle);
        }
        $('#suttle').val(suttle);
        $('#closeSymbol').val('计量完毕');
    }

    $('#outcollection').addClass("disabled");
    $('#outSave').removeClass("disabled");

});